<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl" alt="">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      },
      swiperList: [
        {
          id: '0001',
          imgUrl: 'http://img2.yidejia.com/5/2019/04/20/51f8502b3bf7d.jpg'
        },
        {
          id: '0002',
          imgUrl: 'http://img2.yidejia.com/4/2019/03/08/ff66c0a352c.jpg'
        },
        {
          id: '0003',
          imgUrl: 'http://img2.yidejia.com/3/2019/03/08/ff760647440.jpg'
        },
        {
          id: '0004',
          imgUrl: 'http://img2.yidejia.com/3/2019/03/08/ff91faa6b04.jpg'
        }
      ]
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper >>> .swiper-pagination-bullet
    width .2rem
    height .2rem
  .wrapper >>> .swiper-pagination-bullet-active
    background rgba(0,0,0,.6)
  .wrapper
    width 100%
    height 0
    overflow hidden
    padding-bottom 45.56%
    margin-top 1rem
    .swiper-img
      width 100%
</style>
